package com.wing.common.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.context.WebApplicationContext;

import com.wing.common.Constants;
import com.wing.common.services.ServiceManager;

public class WingServlet extends HttpServlet {
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
	}

	public void init() throws ServletException {
		WebApplicationContext wac = (WebApplicationContext) this
				.getServletContext()
				.getAttribute(Constants.SPRING_SERVLET_DISPLAY_NAME);
		ServiceManager serviceManager = (ServiceManager) wac
				.getBean("serviceManager");
		try {
			serviceManager.init(this.getServletConfig());
		} catch (Exception e) {
			e.printStackTrace();
		}
		


	}
}
